#include <iostream>

#include "government.hpp"
#include "raster.hpp"

government::government() : treasury_(0), city_name_index_(0)
{
	color_ = graphics::color_red();
	city_names_.push_back("Weldyn");
	city_names_.push_back("Anduin");
	city_names_.push_back("Elensefar");

	can_recruit_.push_back("settler");
	can_recruit_.push_back("militia");
}

std::string government::generate_city_name()
{
	if(city_names_.empty()) {
		return "City";
	}

	return city_names_[city_name_index_++%city_names_.size()];
}

bool government::is_unshrouded(int x, int y) const
{
	return true;
	if(y < 0 || x < 0 || y >= unshrouded_.size() || x >= unshrouded_[y].size()) {
		return false;
	}

	return unshrouded_[y][x];
}

void government::unshroud(int x, int y)
{
	if(y < 0 || x < 0) {
		return;
	}

	if(y >= unshrouded_.size()) {
		unshrouded_.resize(y + 1);
	}

	if(x >= unshrouded_[y].size()) {
		unshrouded_[y].resize(x + 1);
	}

	std::cerr << "unshroud " << x << "," << y << "\n";
	unshrouded_[y][x] = true;
}

variant government::get_value(const std::string& key) const
{
	return variant();
}
